# -*- coding: utf-8 -*-
# ASI_ERROR_CODE.py was created by RuanYaoHuang on 2023/4/1.

import ctypes

# Define the ASI_ERROR_CODE enumeration
class ASI_ERROR_CODE(ctypes.c_int):
    ASI_SUCCESS = 0
    ASI_ERROR_INVALID_INDEX = 1
    ASI_ERROR_INVALID_ID = 2
    ASI_ERROR_INVALID_CONTROL_TYPE = 3
    ASI_ERROR_CAMERA_CLOSED = 4
    ASI_ERROR_CAMERA_REMOVED = 5
    ASI_ERROR_INVALID_PATH = 6
    ASI_ERROR_INVALID_FILEFORMAT = 7
    ASI_ERROR_INVALID_SIZE = 8
    ASI_ERROR_INVALID_IMGTYPE = 9
    ASI_ERROR_OUTOF_BOUNDARY = 10
    ASI_ERROR_TIMEOUT = 11
    ASI_ERROR_INVALID_SEQUENCE = 12
    ASI_ERROR_BUFFER_TOO_SMALL = 13
    ASI_ERROR_VIDEO_MODE_ACTIVE = 14
    ASI_ERROR_EXPOSURE_IN_PROGRESS = 15
    ASI_ERROR_GENERAL_ERROR = 16
    ASI_ERROR_INVALID_MODE = 17
    ASI_ERROR_END = 18

    @classmethod
    def get_members(cls):
        members = []
        for name in dir(cls):
            if not name.startswith('_') and name != 'value' and name != 'get_members':
                value = getattr(cls, name)
                if isinstance(value, int):
                    members.append((value, name))
        members.sort()
        return members

#
# for value, name in ASI_ERROR_CODE.get_members():
#     print(value, name)